<style>
    table > tbody > tr > td, table > thead > tr > th {
        border: 1px solid #000000 !important;
        font-size: 16px;
    }
</style>
<div class="row-content am-cf">
    <div class="row">
        <div class="am-u-sm-12 am-u-md-12 am-u-lg-12">
            <div class="widget am-cf">
                <div class="widget-head am-cf">
                    <div class="widget-title  am-cf">设备详情</div>
                </div>
                <div class="widget-body  am-fr">
                    <div class="am-u-sm-12 am-u-md-6 am-u-lg-6">
                        <div class="am-form-group">
                            <div class="am-btn-toolbar">
                                <div class="am-btn-group am-btn-group-xs">
                                    <!-- <button type="button" class="am-btn am-btn-default am-btn-success" id="btnPrint"
                                             onclick="print()">
                                         <span class="am-icon-plus"></span> 打印
                                     </button>-->
                                    <button type="button" onclick="loadPage('deviceInformation/search')"
                                            class="am-btn am-btn-default am-btn-danger ">返回
                                    </button>
                                </div>
                                <div class="widget-body am-fr" th:each="record:${deviceInformationList}"
                                     id="printContent">
                                    <table class="table table-bordered am-text-nowrap table-responsive text-center"
                                           style="margin-top: 60px; background-repeat:no-repeat;">
                                        <thead>
                                        <tr style="border: 0px solid transparent !important;">
                                            <th colspan="7" class="text-center"
                                                style="border:1px solid transparent !important;">
                                                <span style="font-size: 24px;"><strong>设备详情</strong></span>
                                            </th>
                                        </tr>
                                        </thead>
                                        <tbody class="print-border">
                                        <tr class="">
                                            <td colspan="1">
                                                <span>所有人</span>
                                            </td>
                                            <td colspan="2"><span
                                                    th:text="${record.registerName != null} ? ${record.registerName} : ''"></span>
                                            </td>
                                            <td colspan="1">
                                                <input type="radio"
                                                       th:checked="${record.userType != null and record.userType == '0'}"
                                                       class="radio-inline">个人</input>
                                                <input type="radio"
                                                       th:checked="${record.userType != null and record.userType == '1'}"
                                                       class="radio-inline">企业</input>
                                            </td>
                                            <td colspan="1">
                                                <span>发票</span>
                                            </td>
                                            <td colspan="2">
                                                <input type="radio"
                                                       th:checked="${record.isInvoice != null and record.isInvoice == '0'}"
                                                       class="radio-inline">无</input>
                                                <input type="radio"
                                                       th:checked="${record.isInvoice != null and record.isInvoice == '1'}"
                                                       class="radio-inline">有</input>
                                            </td>
                                        </tr>
                                        <tr class="text-center">
                                            <td colspan="1">
                                                <span>有效通讯地址</span>
                                            </td>
                                            <td colspan="3">
                                                <span th:text="${record.address != null} ? ${record.address} : ''"></span>
                                            </td>
                                            <td colspan="1">
                                                <span>申请人联系电话</span>
                                            </td>
                                            <td colspan="2">
                                                <span th:text="${record.registerPhone != null} ? ${record.registerPhone} : ''"></span>
                                            </td>
                                        </tr>
                                        <!--转入申请人-->
                                        <tr class="text-center">
                                            <td colspan="1">
                                                <span>企业联系人</span>
                                            </td>
                                            <td colspan="2">
                                                <span th:text="${record.enterLinkMan != null} ? ${record.enterLinkMan} : ''"></span>
                                            </td>
                                            <td colspan="1">
                                                <span>组织机构代码</span>
                                            </td>
                                            <td colspan="3">
                                                <span th:text="${record.orgCode != null} ? ${record.orgCode} : ''"></span>
                                            </td>
                                        </tr>
                                        <tr class="text-center" colspan="1">
                                            <td rowspan="3">
                                                <span>机械信息</span>
                                            </td>
                                            <td colspan="1">
                                                <span>品牌</span>
                                            </td>
                                            <td colspan="1">
                                                <span th:text="${record.deviecBrand != null} ? ${record.deviecBrand} : ''"></span>
                                            </td>
                                            <td colspan="1">
                                                <span>类型</span>
                                            </td>
                                            <td colspan="1">
                                                <div th:if="${record.machineryType != null}"
                                                     th:switch="${record.machineryType}">
                                                    <span th:case="0">挖掘机</span>
                                                    <span th:case="1">装载机</span>
                                                    <span th:case="2">矿用自卸车</span>
                                                    <span th:case="3">推土机</span>
                                                    <span th:case="4">压路机</span>
                                                    <span th:case="5">平地机</span>
                                                    <span th:case="6">混凝土机械</span>
                                                    <span th:case="7">桩工机械</span>
                                                    <span th:case="8">凿岩机械</span>
                                                    <span th:case="9">摊铺机</span>
                                                    <span th:case="10">俩头忙</span>
                                                    <span th:case="11">旋挖钻</span>
                                                    <span th:case="12">叉车</span>
                                                    <span th:case="13">塔式起重机</span>
                                                </div>
                                            </td>
                                            <td colspan="1">
                                                <span>型号</span>
                                            </td>
                                            <td colspan="1">
                                                <span th:text="${record.plateSubject != null} ? ${record.plateSubject} : ''"></span>
                                            </td>
                                        </tr>
                                        <tr class="text-center">
                                            <td colspan="1">
                                                <span>发动机型号</span>
                                            </td>
                                            <td colspan="2">
                                                <span th:text="${record.engineSubject != null} ? ${record.engineSubject} : ''"></span>
                                            </td>
                                            <td colspan="1">
                                                <span>出厂日期</span>
                                            </td>
                                            <td colspan="2">
                                                <span th:if="${record.dateOfProduction != null}"
                                                      th:text="${#dates.format(record.dateOfProduction, 'yyyy年MM月dd日')}"></span>
                                            </td>
                                        </tr>
                                        <tr class="text-center">
                                            <td colspan="1">
                                                <span>发动机功率</span>
                                            </td>
                                            <td colspan="1">
                                                <span th:text="${record.power != null} ? ${record.power} : ''"></span><span>kw</span>
                                            </td>
                                            <td colspan="1">
                                                <span>购买日期</span>
                                            </td>
                                            <td colspan="1">
                                                <span th:if="${record.resBuyDate != null}"
                                                      th:text="${#dates.format(record.resBuyDate, 'yyyy-MM-dd')}"></span>
                                            </td>
                                            <td colspan="1">
                                                <span>发动机编号</span>
                                            </td>
                                            <td colspan="1">
                                                <span th:text="${record.enginePlateNum != null} ? ${record.enginePlateNum} : ''"></span>
                                            </td>
                                        </tr>
                                        <tr class="text-center">
                                            <td colspan="1">
                                                <input type="radio"
                                                       th:checked="${record.productionType != null and record.productionType == '0'}"
                                                       class="radio-inline">国产</input>
                                                <input type="radio"
                                                       th:checked="${record.productionType != null and record.productionType == '1'}"
                                                       class="radio-inline">合资</input>
                                                <input type="radio"
                                                       th:checked="${record.productionType != null and record.productionType == '2'}"
                                                       class="radio-inline">进口</input>
                                            </td>
                                            <td colspan="1">
                                                <span>产地</span>
                                            </td>
                                            <td colspan="1">
                                                <span th:text="${record.productionAddress != null} ? ${record.productionAddress} : ''"></span>
                                            </td>
                                            <td colspan="1">
                                                <span>行走方式</span>
                                            </td>
                                            <td colspan="1">
                                                <input type="radio"
                                                       th:checked="${record.maneuver != null and record.maneuver == '0'}"
                                                       class="radio-inline">轮式</input>
                                                <input type="radio"
                                                       th:checked="${record.maneuver != null and record.maneuver == '1'}"
                                                       class="radio-inline">履带</input>
                                            </td>
                                            <td colspan="1">
                                                <span>工作小时</span>
                                            </td>
                                            <td colspan="1">
                                                <span th:text="${record.workTime != null} ? ${record.workTime} : ''"></span><span>H</span>
                                            </td>
                                        </tr>
                                        <tr class="text-center">
                                            <td colspan="1">
                                                <span>燃油种类</span>
                                            </td>
                                            <td colspan="1">
                                                <input type="radio"
                                                       th:checked="${record.fuel != null and record.fuel == '0'}"
                                                       class="radio-inline">柴油</input>
                                                <input type="radio"
                                                       th:checked="${record.fuel != null and record.fuel == '1'}"
                                                       class="radio-inline">汽油</input>
                                                <input type="radio"
                                                       th:checked="${record.fuel != null and record.fuel == '2'}"
                                                       class="radio-inline">天然气</input>
                                            </td>

                                            <td colspan="2">
                                                <input type="radio"
                                                       th:checked="${record.mortgage != null and record.mortgage == '0'}"
                                                       class="radio-inline">未抵押</input>
                                                <input type="radio"
                                                       th:checked="${record.mortgage != null and record.mortgage == '1'}"
                                                       class="radio-inline">已抵押</input>
                                            </td>
                                            <td colspan="1">
                                                <span>尾气排放值</span>
                                            </td>
                                            <td colspan="2">
                                                <input type="radio"
                                                       th:checked="${record.outputVolume != null and record.outputVolume == '0'}"
                                                       class="radio-inline">未检测</input>
                                                <input type="radio"
                                                       th:checked="${record.outputVolume != null and record.outputVolume == '1'}"
                                                       class="radio-inline">已检测</input>
                                            </td>
                                        </tr>
                                        <tr>
                                            <td colspan="1">
                                                <span>出厂编号</span>
                                            </td>
                                            <td colspan="3">
                                                <span th:text="${record.factoryNum != null} ? ${record.factoryNum} : ''"></span>
                                            </td>
                                            <td colspan="1">
                                                <span>设备牌编号</span>
                                            </td>
                                            <td colspan="2">
                                                <span th:text="${record.plateNum != null} ? ${record.plateNum} : ''"></span>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                    <div class="">
                                        <div colspan="1" th:each="record:${urlList}">
                                            <span> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                设备照片
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                            <span>
                                                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                <img th:src="${record!= null} ? ${record} : ''" width="250px"
                                                     height="160px"/>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="">
                                        <div colspan="1" th:each="record:${userList}">
                                            <span>申请人身份证照片,发票照片&nbsp;&nbsp;&nbsp;&nbsp;</span>
                                            <span>
                                                <img th:src="${record!= null} ? ${record} : ''" width="250px"
                                                     height="160px"/>
                                            </span>
                                        </div>
                                    </div>
                                    <div class="">
                                        <div colspan="1" th:each="record:${invoiceList}">
                                            <span>买方身份证照片,合同签字照片</span>
                                            <span>
                                                <img th:src="${record!= null} ? ${record} : ''" width="250px"
                                                     height="160px"/>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript" th:src="@{/ui/js/jQuery.print.js}"/>
<style type="text/css">
    div img {
        cursor: pointer;
        transition: all 0.6s; /*放大时间*/
    }
    div img:hover {
        transform: scale(2.5); /*放大倍数*/
    }
</style>
<script type="text/javascript">
    function print() {
        $("#printContent").print({
            globalStyles: true,//是否包含父文档的样式，默认为true
            mediaPrint: false,//是否包含media='print'的链接标签。会被globalStyles选项覆盖，默认为false
            stylesheet: null,//外部样式表的URL地址，默认为null

            noPrintSelector: ".no-print",//不想打印的元素的jQuery选择器，默认为".no-print"
            append: null,//将内容添加到打印内容的后面
            prepend: null//将内容添加到打印内容的前面，可以用来作为要打印内容
            //deferred:
            //   $.Deferred()//回调函数
        });
    }
</script>